#BLP data on x variables and xi====
BLP <- fread("../Tables/CF_BLPdata/BLP_xandxi1990_1e+05hh_normal.csv")
xandxi.BLP <- BLP[mc>0,.(vxi,hpwt,air,mpd,space,xi,mc)]  # four key attributes in a DT, needed in DGP.exog()
colnames(xandxi.BLP) <- c("vxi",paste0("x",1:4),"xi","mc")
#
#BLP coefficients on variables (central parameters)====
param <- fread("../Data/BLP99/published_param.csv")
param[, xvar := st_right(param_name,"_")]
GAMMA <- param[param_name %like% "supply_"]$pub_param # skip the trend
GAMMA[1] <- GAMMA[1]+GAMMA[6]*20 # t= 20 in 1990, so this is implied value of trend
GAMMA <- GAMMA[1:5]  # drop the trend coefficient
BETA <- param[param_name %like% "demand_"]$pub_param
SIGMA.BETA <- param[param_name %like% "sigma_"]$pub_param
#
# BLP income distribution data 
y.mn <- fread("../Data/BLP99/meanincome.csv")
y.mn[, year := V1+1900]
MU.LY <- y.mn[year==1990]$V2
SIGMA.LY <- fread("../Data/BLP99/sdincome.csv")$V1
#
#BLP SD of xi, extracted from inversion (in CF_BLPdata.R), not used anymore====
SDxi <- fread("../Tables/CF_BLPdata/BLPsd_xi.csv")